Northwoods.GoWPF 2.2.4 Assembly
LoadFromXElement Method (GraphLinksModelLinkData<NodeKey,PortKey>)

the XElement
Initialize this link data with data held in a Linq for XML XElement.
Syntax
Public Overridable Sub LoadFromXElement( _
   ByVal e As XElement _
) 
public virtual void LoadFromXElement( 
   XElement e
)

Parameters

e
the XElement
Remarks

This sets this link data's properties by reading the data from attributes and nested elements of the given XElement.

Because the NodeKey type might be a type for which we have an implementation to convert to and from strings for XML, this calls the ConvertStringToNodeKey method, which you can override.

This is implemented as: public virtual void LoadFromXElement(XElement e) { this.From = XHelper.Read<NodeKey>("From", e, default(NodeKey), ConvertStringToNodeKey); this.To = XHelper.Read<NodeKey>("To", e, default(NodeKey), ConvertStringToNodeKey); this.FromPort = XHelper.Read<PortKey>("FromPort", e, default(PortKey), ConvertStringToPortKey); this.ToPort = XHelper.Read<PortKey>("ToPort", e, default(PortKey), ConvertStringToPortKey); this.LabelNode = XHelper.Read<NodeKey>("LabelNode", e, default(NodeKey), ConvertStringToNodeKey); this.Category = XHelper.Read("Category", e, ""); this.Text = XHelper.Read("Text", e, ""); this.Points = XHelper.Read("Points", e, (IEnumerable<Point>)null); }

If you add properties to this link data class, and if you are using the GraphLinksModel<NodeType,NodeKey,PortKey,LinkType>.Save<NodeDataType,LinkDataType> and GraphLinksModel<NodeType,NodeKey,PortKey,LinkType>.Load<NodeDataType,LinkDataType> methods, you should override this method to add new attributes and/or elements as needed, and you should override MakeXElement.

Requirements
See Also

Reference

GraphLinksModelLinkData<NodeKey,PortKey> Class
GraphLinksModelLinkData<NodeKey,PortKey> Members

 

 


© Northwoods Software 2017. All Rights Reserved.

Send Feedback